<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="created" content="2019-12-31T06:18:10.521000000">
    <meta name="changed" content="2019-12-31T06:45:12.725000000">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en">
    <title>
      Splitters
    </title>
    <link rel="stylesheet" type="text/css" href="../../style.css">
  </head>
  <body>
    <div class="maindiv">
      <h1>
        Splitters
      </h1>
      <p>
        When you work with multi-bit values, you will often want to route different bits in different directions. The Wiring library's <b class=propertie>splitter</b> tool (<img class=intxt src="../../../../img-guide/splitter1.png" alt="#########">) allows you to accomplish this.
      </p>
      <p>
        For example, suppose we want a circuit that computes the bitwise AND of the two nibbles of its eight-bit input (the upper four bits and the lower four bits). We will have an eight-bit value coming from the input pin, and we want to split that into two four-bit values. In the below circuit, we have used a splitter to accomplish this: The 8-bit input comes into the splitter, which divides the 8 bits into two 4-bit values, which are then fed into the AND gate and from there to the output.
      </p>
      <p align="center">
        <img class="notscal" src="../../../../img-guide/bundles-splitter-circ.png" alt="#########">
      </p>
      <p>
        In this example, the splitter <b>splits</b> an incoming value into multiple outgoing values. But splitters can also work the other way: It can <b>combine</b> multiple values into a single value. In fact, they are non-directional: They can send values one way at one time and another way later, and they can even do both at the same time, as in the below example where a value travels eastward through the two splitters, then is routed back westward through them again, and then back eastward where it finally reaches its output.
      </p>
      <p align="center">
        <img class="notscal" src="../../../../img-guide/bundles-splitter-2way.png" alt="#########">
      </p>
      <p>
        The key to understanding splitters is their attributes. In the following, the term <b>Split End</b> refers to one of the multiple wires on one side, while the term <b>data bus</b> refers to the single wire on the other side.
      </p>
      <ul>
        <li>The <b class=propertie>Facing</b> attribute tells where the split ends should be relative to the Fan Out.
          <div>
            <table>
              <tbody>
                <tr>
                  <td valign="top">
                    Data bus
                  </td>
                  <td>
                    <br>
                    <img class="notscal" src="../../../../img-guide/splitter-right.png" align="middle" alt="#########">
                  </td>
                  <td>
                    Split End
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </li>
        <li>The <b class=propertie>Fan Out</b> attribute specifies how many split ends there are.
        </li>
        <li>The <b class=propertie>Bit Width In</b> attribute specifies the bit width of the combined end.
        </li>
		<li>The <b class=propertie>Appearence</b> defines how the split end is drawn relative to its data bus.<br>
          <div class="twodiv">
            <table>
              <tbody>
                <tr>
                  <td>
                    <img class="notscal" src="../../../../img-libs/splitter-right.png" align="middle" alt="#########">
                  </td>
                  <td>
                    <img class="notscal" src="../../../../img-libs/splitter-left.png" align="middle" alt="#########">
                  </td>
                </tr>
                <tr>
                  <td>
                    Right
                  </td>
                  <td>
                    Left
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <div class="twodiv">
            <table>
              <tbody>
                <tr>
                  <td>
                    <img class="notscal" src="../../../../img-guide/splitter-center.png" align="middle" alt="#########">
                  </td>
                  <td>
                    <img class="notscal" src="../../../../img-guide/splitter-legacy.png" align="middle" alt="#########">
                  </td>
                </tr>
                <tr>
                  <td>
                    Center
                  </td>
                  <td>
                    Legacy
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
        </li>
        <li>The <b class=propertie>Spacing</b> specifies the space between the split end.
        </li>
        <li>
		The <b class=propertie>Bit <var>x</var></b> attributes define which separate split end corresponds to which bit <b>x</b> of the data bus. It is modifiable and allows you to organize the order of split end by hand. If several bits correspond to the same split end (first example above), then the relative order will be the same as in the bus. Logisim distributors cannot have a bus bit linked to more than one split end.
        </li>
      </ul>
      <p>
        Note that any change to the Fan Out or Bit Width In attributes will reset all Bit <var>x</var> attributes so that they will distribute the bits of the combined value as evenly as possible among the split ends.
      </p>
      <p>
        <b>Next:</b> <a href="fet-colors.html">Wire colors</a>.
      </p>
    </div>
  </body>
</html>
